package com.new2i.dao.impl;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
  
import com.new2i.dao.able.ScreenDoctorDao; 
import com.new2i.dao.mapper.ScreenDoctorMapper; 
import com.new2i.model.ScreenDoctorEntity; 

/**
 * 筛查医生数据库访问的实现类
 * 
 * @since 2015/09/22
 * @author 2i
 *
 */
@Repository("ScreenDoctorDao")
public class ScreenDoctorDaoImpl implements ScreenDoctorDao{

	@Autowired
	private ScreenDoctorMapper screenDoctorMapper;

	@Override
	public List<HashMap<String, Object>> selectScreenDoctorList(Integer doctor_id, Integer page) {
		if(page == null || page <= 0) 
			page = 1;
		Integer limit = 10; 
		Integer start = (page - 1) * limit;
		return screenDoctorMapper.selectScreenDoctorList(doctor_id,start,limit);
	}

	@Override
	public ScreenDoctorEntity insertScreenDoctor(ScreenDoctorEntity scDoctor) {
		screenDoctorMapper.insertScreenDoctor(scDoctor);
		return scDoctor;
	}

	@Override
	public HashMap<String, Object> getScreenDoctorByTel(String tel) { 
		return screenDoctorMapper.getScreenDoctorByTel(tel);
	}

	@Override
	public Integer updateScreenDoctorPassword(Integer sc_doctor_id,  String password, String new_password) { 
		return screenDoctorMapper.updateScreenDoctorPassword(sc_doctor_id,password,new_password); 
	}
 
	@Override
	public Integer removeScreenDoctor(Integer sc_doctor_id,Integer doctor_id) {
		return screenDoctorMapper.removeScreenDoctor(sc_doctor_id,doctor_id); 
	} 
	
	@Override
	public Integer deleteScreenDoctor(Integer sc_doctor_id,Integer doctor_id) {
		return screenDoctorMapper.deleteScreenDoctor(sc_doctor_id,doctor_id); 
	} 

}
